<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>mkfs.fat移植和使用 | 风往北吹</title><meta name="author" content="Aodi"><meta name="copyright" content="Aodi"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="调试过程记录，尽可能用最简洁的话把原理说清楚。  mkfs.fat移植和使用一、引言1.1、背景客户需求，需要在arm linux中格式化sd卡，格式化成fat格式。 1.2、文章目的总结归档，输出快速可移植、可操作、可执行的指引文档。 如果不想看更多的内容，而是直接拿到板子上手使用，请移步到 使用指南 。 二、项目概述2.1、功能简介正常使用这个命令。 12345678910111213141">
<meta property="og:type" content="article">
<meta property="og:title" content="mkfs.fat移植和使用">
<meta property="og:url" content="http://example.com/2024/09/05/mkfs.fat-yi-zhi-he-shi-yong/index.html">
<meta property="og:site_name" content="风往北吹">
<meta property="og:description" content="调试过程记录，尽可能用最简洁的话把原理说清楚。  mkfs.fat移植和使用一、引言1.1、背景客户需求，需要在arm linux中格式化sd卡，格式化成fat格式。 1.2、文章目的总结归档，输出快速可移植、可操作、可执行的指引文档。 如果不想看更多的内容，而是直接拿到板子上手使用，请移步到 使用指南 。 二、项目概述2.1、功能简介正常使用这个命令。 12345678910111213141">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240905201133-8xv7fv1.png">
<meta property="article:published_time" content="2024-09-05T11:54:05.000Z">
<meta property="article:modified_time" content="2024-09-05T12:15:07.793Z">
<meta property="article:author" content="Aodi">
<meta property="article:tag" content="文件系统">
<meta property="article:tag" content="FAT32">
<meta property="article:tag" content="SS928">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240905201133-8xv7fv1.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://example.com/2024/09/05/mkfs.fat-yi-zhi-he-shi-yong/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: undefined,
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  infinitegrid: {
    js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
    buttonText: '加载更多'
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'mkfs.fat移植和使用',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2024-09-05 20:15:07'
}</script><script>(win=>{
      win.saveToLocal = {
        set: (key, value, ttl) => {
          if (ttl === 0) return
          const now = Date.now()
          const expiry = now + ttl * 86400000
          const item = {
            value,
            expiry
          }
          localStorage.setItem(key, JSON.stringify(item))
        },
      
        get: key => {
          const itemStr = localStorage.getItem(key)
      
          if (!itemStr) {
            return undefined
          }
          const item = JSON.parse(itemStr)
          const now = Date.now()
      
          if (now > item.expiry) {
            localStorage.removeItem(key)
            return undefined
          }
          return item.value
        }
      }
    
      win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
        const script = document.createElement('script')
        script.src = url
        script.async = true
        script.onerror = reject
        script.onload = script.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          script.onload = script.onreadystatechange = null
          resolve()
        }

        Object.keys(attr).forEach(key => {
          script.setAttribute(key, attr[key])
        })

        document.head.appendChild(script)
      })
    
      win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
        const link = document.createElement('link')
        link.rel = 'stylesheet'
        link.href = url
        if (id) link.id = id
        link.onerror = reject
        link.onload = link.onreadystatechange = function() {
          const loadState = this.readyState
          if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
          link.onload = link.onreadystatechange = null
          resolve()
        }
        document.head.appendChild(link)
      })
    
      win.activateDarkMode = () => {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = () => {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
        if (t === 'dark') activateDarkMode()
        else if (t === 'light') activateLightMode()
      
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
      const detectApple = () => {
        if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
          document.documentElement.classList.add('apple')
        }
      }
      detectApple()
    })(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>(()=>{
  const $loadingBox = document.getElementById('loading-box')
  const $body = document.body
  const preloader = {
    endLoading: () => {
      $body.style.overflow = ''
      $loadingBox.classList.add('loaded')
    },
    initLoading: () => {
      $body.style.overflow = 'hidden'
      $loadingBox.classList.remove('loaded')
    }
  }

  preloader.initLoading()
  window.addEventListener('load',() => { preloader.endLoading() })

  if (false) {
    document.addEventListener('pjax:send', () => { preloader.initLoading() })
    document.addEventListener('pjax:complete', () => { preloader.endLoading() })
  }
})()</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/Header.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">2</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">7</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><hr class="custom-hr"/></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240905201133-8xv7fv1.png')"><nav id="nav"><span id="blog-info"><a href="/" title="风往北吹"><span class="site-name">风往北吹</span></a></span><div id="menus"><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">mkfs.fat移植和使用</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2024-09-05T11:54:05.000Z" title="发表于 2024-09-05 19:54:05">2024-09-05</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2024-09-05T12:15:07.793Z" title="更新于 2024-09-05 20:15:07">2024-09-05</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E9%A1%B9%E7%9B%AE%E8%AE%B0%E5%BD%95/">项目记录</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E9%A1%B9%E7%9B%AE%E8%AE%B0%E5%BD%95/%E8%B0%83%E8%AF%95%E8%AE%B0%E5%BD%95/">调试记录</a><i class="fas fa-angle-right post-meta-separator"></i><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E9%A1%B9%E7%9B%AE%E8%AE%B0%E5%BD%95/%E8%B0%83%E8%AF%95%E8%AE%B0%E5%BD%95/%E5%B5%8C%E5%85%A5%E5%BC%8F/">嵌入式</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">1.2k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>6分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="mkfs.fat移植和使用"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><blockquote>
<p>调试过程记录，尽可能用最简洁的话把原理说清楚。</p>
</blockquote>
<h1 id="mkfs-fat移植和使用"><a href="#mkfs-fat移植和使用" class="headerlink" title="mkfs.fat移植和使用"></a>mkfs.fat移植和使用</h1><h1 id="一、引言"><a href="#一、引言" class="headerlink" title="一、引言"></a>一、引言</h1><h2 id="1-1、背景"><a href="#1-1、背景" class="headerlink" title="1.1、背景"></a>1.1、背景</h2><p>客户需求，需要在arm linux中格式化sd卡，格式化成fat格式。</p>
<h2 id="1-2、文章目的"><a href="#1-2、文章目的" class="headerlink" title="1.2、文章目的"></a>1.2、文章目的</h2><p>总结归档，输出快速可移植、可操作、可执行的指引文档。</p>
<p>如果不想看更多的内容，而是直接拿到板子上手使用，请移步到 使用指南 。</p>
<h1 id="二、项目概述"><a href="#二、项目概述" class="headerlink" title="二、项目概述"></a>二、项目概述</h1><h2 id="2-1、功能简介"><a href="#2-1、功能简介" class="headerlink" title="2.1、功能简介"></a>2.1、功能简介</h2><p>正常使用这个命令。</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">mkfs.fat --help</span><br><span class="line">mkfs.fat 4.2 (2021-01-31)</span><br><span class="line">Usage: mkfs.fat [OPTIONS] TARGET [BLOCKS]</span><br><span class="line">Create FAT filesystem in TARGET, which can be a block device or file. Use only</span><br><span class="line">up to BLOCKS 1024 byte blocks if specified. With the -C option, file TARGET will be</span><br><span class="line">created with a size of 1024 bytes times BLOCKS, which must be specified.</span><br><span class="line"></span><br><span class="line">Options:</span><br><span class="line">  -a              Disable alignment of data structures</span><br><span class="line">  -A              Toggle Atari variant of the filesystem</span><br><span class="line">  -b SECTOR       Select SECTOR as location of the FAT32 backup boot sector</span><br><span class="line">  -c              Check device for bad blocks before creating the filesystem</span><br><span class="line">  -C              Create file TARGET then create filesystem in it</span><br><span class="line">  -D NUMBER       Write BIOS drive number NUMBER to boot sector</span><br><span class="line">  -f COUNT        Create COUNT file allocation tables</span><br><span class="line">  -F SIZE         Select FAT size SIZE (12, 16 or 32)</span><br><span class="line">  -g GEOM         Select disk geometry: heads/sectors_per_track</span><br><span class="line">  -h NUMBER       Write hidden sectors NUMBER to boot sector</span><br><span class="line">  -i VOLID        Set volume ID to VOLID (a 32 bit hexadecimal number)</span><br><span class="line">  -I              Ignore and disable safety checks</span><br><span class="line">  -l FILENAME     Read bad blocks list from FILENAME</span><br><span class="line">  -m FILENAME     Replace default error message in boot block with contents of FILENAME</span><br><span class="line">  -M TYPE         Set media type in boot sector to TYPE</span><br><span class="line">  --mbr[=y|n|a]   Fill (fake) MBR table with one partition which spans whole disk</span><br><span class="line">  -n LABEL        Set volume name to LABEL (up to 11 characters long)</span><br><span class="line">  --codepage=N    use DOS codepage N to encode label (default: 850)</span><br><span class="line">  -r COUNT        Make room for at least COUNT entries in the root directory</span><br><span class="line">  -R COUNT        Set minimal number of reserved sectors to COUNT</span><br><span class="line">  -s COUNT        Set number of sectors per cluster to COUNT</span><br><span class="line">  -S SIZE         Select a sector size of SIZE (a power of two, at least 512)</span><br><span class="line">  -v              Verbose execution</span><br><span class="line">  --variant=TYPE  Select variant TYPE of filesystem (standard or Atari)</span><br><span class="line"></span><br><span class="line">  --invariant     Use constants for randomly generated or time based values</span><br><span class="line">  --offset=SECTOR Write the filesystem at a specific sector into the device file.</span><br><span class="line">  --help          Show this help message and exit</span><br></pre></td></tr></table></figure>

<h1 id="三、环境准备"><a href="#三、环境准备" class="headerlink" title="三、环境准备"></a>三、环境准备</h1><h2 id="3-1、产品需求"><a href="#3-1、产品需求" class="headerlink" title="3.1、产品需求"></a>3.1、产品需求</h2><p>支持 mkfs.fat这条命令</p>
<h2 id="3-2、硬件配置"><a href="#3-2、硬件配置" class="headerlink" title="3.2、硬件配置"></a>3.2、硬件配置</h2><p>1、任意ss928的板子，本次使用的是安防S4主板。</p>
<p>2、通过网口完成数据传输及命令行交互</p>
<h2 id="3-3、软件配置"><a href="#3-3、软件配置" class="headerlink" title="3.3、软件配置"></a>3.3、软件配置</h2><p>1、secureCRT工具（可选）</p>
<p>2、ssh等一些常用的网络调试工具</p>
<h1 id="四、实现要点"><a href="#四、实现要点" class="headerlink" title="四、实现要点"></a>四、实现要点</h1><h3 id="4-1、关键步骤"><a href="#4-1、关键步骤" class="headerlink" title="4.1、关键步骤"></a>4.1、关键步骤</h3><h4 id="1）下载源码交叉编译"><a href="#1）下载源码交叉编译" class="headerlink" title="1）下载源码交叉编译"></a>1）下载源码交叉编译</h4><p>详细请看如下命令行交互，所有操作都是在编译主机：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">wget https://github.com/dosfstools/dosfstools/archive/refs/tags/v4.2.tar.gz -O dosfstools-4.2.tar.gz</span><br><span class="line"></span><br><span class="line">tar -xf dosfstools-4.2.tar.gz</span><br><span class="line"><span class="built_in">cd</span> dosfstools-4.2</span><br><span class="line"></span><br><span class="line"><span class="built_in">mkdir</span> __install</span><br><span class="line"></span><br><span class="line">./autogen.sh</span><br><span class="line">./configure --host=aarch64-linux-gnu CC=aarch64-mix210-linux-gcc --prefix=$(<span class="built_in">pwd</span>)/__install</span><br><span class="line"></span><br><span class="line">make</span><br><span class="line">make install</span><br><span class="line"></span><br><span class="line">scp -r __install root@192.168.0.224:/</span><br></pre></td></tr></table></figure>

<h4 id="2）板端更新文件"><a href="#2）板端更新文件" class="headerlink" title="2）板端更新文件"></a>2）板端更新文件</h4><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /</span><br><span class="line"><span class="built_in">cd</span> __install/</span><br><span class="line"><span class="built_in">chmod</span> -R 777 sbin/</span><br><span class="line"><span class="built_in">cp</span> sbin/* /usr/sbin/</span><br><span class="line"></span><br><span class="line">mkfs.fat --<span class="built_in">help</span></span><br></pre></td></tr></table></figure>

<p>‍</p>
<h4 id="3）板端使用这个工具"><a href="#3）板端使用这个工具" class="headerlink" title="3）板端使用这个工具"></a>3）板端使用这个工具</h4><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br></pre></td><td class="code"><pre><span class="line">mkfs.fat -v</span><br><span class="line">mkfs.fat 4.2 (2021-01-31)</span><br><span class="line">No device specified.</span><br><span class="line">Usage: mkfs.fat [OPTIONS] TARGET [BLOCKS]</span><br><span class="line">Create FAT filesystem <span class="keyword">in</span> TARGET, <span class="built_in">which</span> can be a block device or file. Use only</span><br><span class="line">up to BLOCKS 1024 byte blocks <span class="keyword">if</span> specified. With the -C option, file TARGET will be</span><br><span class="line">created with a size of 1024 bytes <span class="built_in">times</span> BLOCKS, <span class="built_in">which</span> must be specified.</span><br><span class="line"></span><br><span class="line">Options:</span><br><span class="line">  -a              Disable alignment of data structures</span><br><span class="line">  -A              Toggle Atari variant of the filesystem</span><br><span class="line">  -b SECTOR       Select SECTOR as location of the FAT32 backup boot sector</span><br><span class="line">  -c              Check device <span class="keyword">for</span> bad blocks before creating the filesystem</span><br><span class="line">  -C              Create file TARGET <span class="keyword">then</span> create filesystem <span class="keyword">in</span> it</span><br><span class="line">  -D NUMBER       Write BIOS drive number NUMBER to boot sector</span><br><span class="line">  -f COUNT        Create COUNT file allocation tables</span><br><span class="line">  -F SIZE         Select FAT size SIZE (12, 16 or 32)</span><br><span class="line">  -g GEOM         Select disk geometry: heads/sectors_per_track</span><br><span class="line">  -h NUMBER       Write hidden sectors NUMBER to boot sector</span><br><span class="line">  -i VOLID        Set volume ID to VOLID (a 32 bit hexadecimal number)</span><br><span class="line">  -I              Ignore and <span class="built_in">disable</span> safety checks</span><br><span class="line">  -l FILENAME     Read bad blocks list from FILENAME</span><br><span class="line">  -m FILENAME     Replace default error message <span class="keyword">in</span> boot block with contents of FILENAME</span><br><span class="line">  -M TYPE         Set media <span class="built_in">type</span> <span class="keyword">in</span> boot sector to TYPE</span><br><span class="line">  --mbr[=y|n|a]   Fill (fake) MBR table with one partition <span class="built_in">which</span> spans whole disk</span><br><span class="line">  -n LABEL        Set volume name to LABEL (up to 11 characters long)</span><br><span class="line">  --codepage=N    use DOS codepage N to encode label (default: 850)</span><br><span class="line">  -r COUNT        Make room <span class="keyword">for</span> at least COUNT entries <span class="keyword">in</span> the root directory</span><br><span class="line">  -R COUNT        Set minimal number of reserved sectors to COUNT</span><br><span class="line">  -s COUNT        Set number of sectors per cluster to COUNT</span><br><span class="line">  -S SIZE         Select a sector size of SIZE (a power of two, at least 512)</span><br><span class="line">  -v              Verbose execution</span><br><span class="line">  --variant=TYPE  Select variant TYPE of filesystem (standard or Atari)</span><br><span class="line"></span><br><span class="line">  --invariant     Use constants <span class="keyword">for</span> randomly generated or time based values</span><br><span class="line">  --offset=SECTOR Write the filesystem at a specific sector into the device file.</span><br><span class="line">  --<span class="built_in">help</span>          Show this <span class="built_in">help</span> message and <span class="built_in">exit</span></span><br></pre></td></tr></table></figure>

<p>‍</p>
<h1 id="五、使用方法"><a href="#五、使用方法" class="headerlink" title="五、使用方法"></a>五、使用方法</h1><p>快速上手指南</p>
<h2 id="5-1、PC端下载工具"><a href="#5-1、PC端下载工具" class="headerlink" title="5.1、PC端下载工具"></a>5.1、PC端下载工具</h2><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> http://10.10.10.7/system/app/rtu_server.git</span><br><span class="line"><span class="built_in">cd</span> rtu_server/misc_tools/dostools/__install</span><br><span class="line"></span><br><span class="line">scp -r __install root@192.168.0.224:/</span><br></pre></td></tr></table></figure>

<h2 id="5-2、板端更新文件"><a href="#5-2、板端更新文件" class="headerlink" title="5.2、板端更新文件"></a>5.2、板端更新文件</h2><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> /</span><br><span class="line"><span class="built_in">cd</span> __install/</span><br><span class="line"><span class="built_in">chmod</span> -R 777 sbin/</span><br><span class="line"><span class="built_in">cp</span> sbin/* /usr/sbin/</span><br><span class="line"></span><br><span class="line">mkfs.fat --<span class="built_in">help</span></span><br></pre></td></tr></table></figure>

<p>‍</p>
<h2 id="5-3、实例，格式化sd卡成FAT32"><a href="#5-3、实例，格式化sd卡成FAT32" class="headerlink" title="5.3、实例，格式化sd卡成FAT32"></a>5.3、实例，格式化sd卡成FAT32</h2><p>1）插入sdcard到板端并键入命令</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">mkfs.fat -F 32 -n MYSDCARD /dev/mmcblk1p1 </span><br><span class="line">mkfs.fat 4.2 (2021-01-31)</span><br><span class="line">mount /dev/mmcblk1p1 /sdcard/</span><br></pre></td></tr></table></figure>

<p>​<code>特别注意:</code>​</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">找到sd卡的设备挂载点</span><br><span class="line"></span><br><span class="line">fdisk -l  </span><br><span class="line"></span><br><span class="line">Disk /dev/mmcblk0: 7456 MB, 7818182656 bytes, 15269888 sectors</span><br><span class="line">238592 cylinders, 4 heads, 16 sectors/track</span><br><span class="line">Units: sectors of 1 * 512 = 512 bytes</span><br><span class="line"></span><br><span class="line">Disk /dev/mmcblk0 doesn<span class="string">&#x27;t contain a valid partition table</span></span><br><span class="line"><span class="string">Disk /dev/mmcblk0p1: 8 MB, 8388608 bytes, 16384 sectors</span></span><br><span class="line"><span class="string">256 cylinders, 4 heads, 16 sectors/track</span></span><br><span class="line"><span class="string">Units: sectors of 1 * 512 = 512 bytes</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">Disk /dev/mmcblk0p1 doesn&#x27;</span>t contain a valid partition table</span><br><span class="line">Disk /dev/mmcblk1: 58 GB, 62075699200 bytes, 121241600 sectors</span><br><span class="line"></span><br><span class="line">这里就是 /dev/mmcblk1p1 就是sd卡的挂载点</span><br></pre></td></tr></table></figure>

<p>2）把卡插回电脑查看</p>
<p>​<img src="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240829144816-xbydsay.png" alt="image">​</p>
<p>​<img src="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240829145228-6giawkk.png" alt="image">​</p>
<p>测试用例（略）</p>
<h1 id="六、总结"><a href="#六、总结" class="headerlink" title="六、总结"></a>六、总结</h1><p>‍</p>
<p>‍</p>
<p>‍</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta"><i class="fas fa-circle-user fa-fw"></i>文章作者: </span><span class="post-copyright-info"><a href="http://example.com">Aodi</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta"><i class="fas fa-square-arrow-up-right fa-fw"></i>文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2024/09/05/mkfs.fat-yi-zhi-he-shi-yong/">http://example.com/2024/09/05/mkfs.fat-yi-zhi-he-shi-yong/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta"><i class="fas fa-circle-exclamation fa-fw"></i>版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://example.com" target="_blank">风往北吹</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F/">文件系统</a><a class="post-meta__tags" href="/tags/FAT32/">FAT32</a><a class="post-meta__tags" href="/tags/SS928/">SS928</a></div><div class="post_share"><div class="social-share" data-image="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240905201133-8xv7fv1.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i>觉得对你有帮助</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/img/wechat_pay.jpg" target="_blank"><img class="post-qr-code-img" src="/img/wechat_pay.jpg" alt="微信"/></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="/img/alipay.jpg" target="_blank"><img class="post-qr-code-img" src="/img/alipay.jpg" alt="支付宝"/></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="next-post pull-full"><a href="/2024/09/05/cms-ping-mu-b080uan01.3-diao-shi-ji-lu/" title="SS928平台上驱动八寸屏幕调试记录"><img class="cover" src="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/20240905195405.png" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">SS928平台上驱动八寸屏幕调试记录</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/2024/09/05/cms-ping-mu-b080uan01.3-diao-shi-ji-lu/" title="SS928平台上驱动八寸屏幕调试记录"><img class="cover" src="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/20240905195405.png" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2024-09-05</div><div class="title">SS928平台上驱动八寸屏幕调试记录</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/Header.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Aodi</div><div class="author-info__description">一个关于嵌入式技术与生活的分享空间</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">2</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">7</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/JalonFungar/test"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="mailto:fungar991133@163.com" target="_blank" title="Email"><i class="as fa-sharp fa-solid fa-envelope" style="color: #74C0FC;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#mkfs-fat%E7%A7%BB%E6%A4%8D%E5%92%8C%E4%BD%BF%E7%94%A8"><span class="toc-number">1.</span> <span class="toc-text">mkfs.fat移植和使用</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%B8%80%E3%80%81%E5%BC%95%E8%A8%80"><span class="toc-number">2.</span> <span class="toc-text">一、引言</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-1%E3%80%81%E8%83%8C%E6%99%AF"><span class="toc-number">2.1.</span> <span class="toc-text">1.1、背景</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#1-2%E3%80%81%E6%96%87%E7%AB%A0%E7%9B%AE%E7%9A%84"><span class="toc-number">2.2.</span> <span class="toc-text">1.2、文章目的</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BA%8C%E3%80%81%E9%A1%B9%E7%9B%AE%E6%A6%82%E8%BF%B0"><span class="toc-number">3.</span> <span class="toc-text">二、项目概述</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#2-1%E3%80%81%E5%8A%9F%E8%83%BD%E7%AE%80%E4%BB%8B"><span class="toc-number">3.1.</span> <span class="toc-text">2.1、功能简介</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%B8%89%E3%80%81%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87"><span class="toc-number">4.</span> <span class="toc-text">三、环境准备</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#3-1%E3%80%81%E4%BA%A7%E5%93%81%E9%9C%80%E6%B1%82"><span class="toc-number">4.1.</span> <span class="toc-text">3.1、产品需求</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-2%E3%80%81%E7%A1%AC%E4%BB%B6%E9%85%8D%E7%BD%AE"><span class="toc-number">4.2.</span> <span class="toc-text">3.2、硬件配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-3%E3%80%81%E8%BD%AF%E4%BB%B6%E9%85%8D%E7%BD%AE"><span class="toc-number">4.3.</span> <span class="toc-text">3.3、软件配置</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%9B%9B%E3%80%81%E5%AE%9E%E7%8E%B0%E8%A6%81%E7%82%B9"><span class="toc-number">5.</span> <span class="toc-text">四、实现要点</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#4-1%E3%80%81%E5%85%B3%E9%94%AE%E6%AD%A5%E9%AA%A4"><span class="toc-number">5.0.1.</span> <span class="toc-text">4.1、关键步骤</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1%EF%BC%89%E4%B8%8B%E8%BD%BD%E6%BA%90%E7%A0%81%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91"><span class="toc-number">5.0.1.1.</span> <span class="toc-text">1）下载源码交叉编译</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2%EF%BC%89%E6%9D%BF%E7%AB%AF%E6%9B%B4%E6%96%B0%E6%96%87%E4%BB%B6"><span class="toc-number">5.0.1.2.</span> <span class="toc-text">2）板端更新文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#3%EF%BC%89%E6%9D%BF%E7%AB%AF%E4%BD%BF%E7%94%A8%E8%BF%99%E4%B8%AA%E5%B7%A5%E5%85%B7"><span class="toc-number">5.0.1.3.</span> <span class="toc-text">3）板端使用这个工具</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E4%BA%94%E3%80%81%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95"><span class="toc-number">6.</span> <span class="toc-text">五、使用方法</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#5-1%E3%80%81PC%E7%AB%AF%E4%B8%8B%E8%BD%BD%E5%B7%A5%E5%85%B7"><span class="toc-number">6.1.</span> <span class="toc-text">5.1、PC端下载工具</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-2%E3%80%81%E6%9D%BF%E7%AB%AF%E6%9B%B4%E6%96%B0%E6%96%87%E4%BB%B6"><span class="toc-number">6.2.</span> <span class="toc-text">5.2、板端更新文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#5-3%E3%80%81%E5%AE%9E%E4%BE%8B%EF%BC%8C%E6%A0%BC%E5%BC%8F%E5%8C%96sd%E5%8D%A1%E6%88%90FAT32"><span class="toc-number">6.3.</span> <span class="toc-text">5.3、实例，格式化sd卡成FAT32</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%85%AD%E3%80%81%E6%80%BB%E7%BB%93"><span class="toc-number">7.</span> <span class="toc-text">六、总结</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/2024/09/05/mkfs.fat-yi-zhi-he-shi-yong/" title="mkfs.fat移植和使用"><img src="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240905201133-8xv7fv1.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="mkfs.fat移植和使用"/></a><div class="content"><a class="title" href="/2024/09/05/mkfs.fat-yi-zhi-he-shi-yong/" title="mkfs.fat移植和使用">mkfs.fat移植和使用</a><time datetime="2024-09-05T11:54:05.000Z" title="发表于 2024-09-05 19:54:05">2024-09-05</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/2024/09/05/cms-ping-mu-b080uan01.3-diao-shi-ji-lu/" title="SS928平台上驱动八寸屏幕调试记录"><img src="https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/20240905195405.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="SS928平台上驱动八寸屏幕调试记录"/></a><div class="content"><a class="title" href="/2024/09/05/cms-ping-mu-b080uan01.3-diao-shi-ji-lu/" title="SS928平台上驱动八寸屏幕调试记录">SS928平台上驱动八寸屏幕调试记录</a><time datetime="2024-09-05T11:54:05.000Z" title="发表于 2024-09-05 19:54:05">2024-09-05</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://siyuannote-991133.oss-cn-shenzhen.aliyuncs.com/Siyuan/image-20240905201133-8xv7fv1.png')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2024 By Aodi</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="/js/tw_cn.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script defer="defer" id="fluttering_ribbon" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/dist/canvas-fluttering-ribbon.min.js"></script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/dist/click-heart.min.js" async="async" mobile="false"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>